﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            
            Cookie Milk = new Cookie(DateTime.Now, 20);
            //Console.WriteLine("Срок годности Молочки: "+Milk.ValidTime);
            ChockoCookie ChockoBoy = new ChockoCookie(DateTime.Now, 15, 2);
           // Console.WriteLine("Срок годности ЧокоБоя: " + ChockoBoy.ValidTime);
            Console.WriteLine("Срок годности печенек: " + Milk.ValidTime+" " + ChockoBoy.ValidTime);
            Console.ReadLine();
        }
    }
    public class Cookie
    {
        public DateTime MadeDate = DateTime.Now;
        public int ValidTime = 24;

        public Cookie(DateTime madeDateTime, int validTime)
        {
            MadeDate = madeDateTime;
            ValidTime = validTime;
        }
        public bool IsCookieGood()
        {
            bool result = true;
            if (MadeDate.AddMonths(ValidTime) <= DateTime.Now)
                result = false;
            return result;
        }
    }
    public class ChockoCookie : Cookie
    {
        public int chockolateType = 0;
        public ChockoCookie(DateTime MadeDate, int ValidTime, int chockolateType)
            : base(MadeDate, ValidTime)
        {
        }
    }
}
